﻿@model IEnumerable<Tecnosop.Dominio.NOTA_DE_CREDITO>
@{
    ViewBag.Title = "Ver notas de crédidto";
    Layout = "~/Views/NotaCredito/_LayoutNotaCredito.cshtml";
}

<fieldset>
<legend>Notas de crédito</legend>
    
@(Html.Telerik().Grid(Model)
        .Name("NotaCrédito")
        .DataKeys(keys => keys.Add(k => k.ID_NOTA_CREDITO))
        .DataBinding(dataBinding => dataBinding.Server()
          .Delete(MVC.NotaCredito.Delete().GetRouteValueDictionary()))
            
            .Columns(columuns =>
            {
                columuns.Bound(c => c.ID_NOTA_CREDITO)
                        .Format(Html.ActionLink("{0}", MVC.NotaCredito.Details("{0}")).ToString())
                        .Encoded(false)
                        .Width(150);
                columuns.Bound(c => c.RAZON_SOCIAL);
                columuns.Bound(c => c.NUMERO_FACTURA);
                columuns.Bound(c => c.FECHA_INSTALACION);
                columuns.Bound(c => c.MONTO);

                columuns.Command(cmd =>
                {
                    cmd.Custom("Editar")
                            .Text("Editar")
                            .Ajax(false)
                            .ButtonType(GridButtonType.ImageAndText)
                            .ImageHtmlAttributes(new { @class = "t-icon t-edit" })
                            .HtmlAttributes(new { @class = "nice radius verysmall white button" })
                            .Action(MVC.NotaCredito.ActionNames.Edit, MVC.NotaCredito.Name);
                    cmd.Delete()
                        .ButtonType(GridButtonType.ImageAndText)
                        .HtmlAttributes(new { @class = "nice radius verysmall red button" });
                }).Width(170);        
                
            })
            .Selectable()
            //.ClientEvents(events => events.OnRowSelect("onRowSelect"))
            .Pageable(paging => paging.PageSize(20))
            .Scrollable(scrolling => scrolling.Enabled(false))
            .PrefixUrlParameters(false)
            .Sortable()
            .Filterable()
            )
            
<br />

            

</fieldset>